package com.xiao.controller;

import com.xiao.entity.Hotel;
import com.xiao.req.SearchByConditionsReq;
import com.xiao.service.HotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Xiao
 * @version 1.0
 * @description
 * @date 2022/2/26 20:26
 */
@RestController
@RequestMapping("/hotel")
public class HotelController {

    @Autowired
    private HotelService hotelService;

    @GetMapping("/getAll")
    public List<Hotel> getAll() {
        return hotelService.getAll();
    }

    @PostMapping("/search")
    public List<Hotel> searchByConditions(@RequestBody SearchByConditionsReq req) {
        return hotelService.searchByConditions(req);
    }
}
